// 1. 引入axios 
import axios from "axios";
// let BASE_URL = "https://www.linweiqin.cn/api/public/v1/home/"
let BASE_URL = process.env.REACT_APP_BASEURL
let instance = axios.create({
    baseURL: BASE_URL
})
// 2. 配置拦截器
instance.interceptors.request.use(function (config) {
    /* 
        1. 添加请求头，token
    */
    return config;
}, function (error) {
    return Promise.reject(error);
})
instance.interceptors.response.use(function (response) {
    return response.data

}, function (error) {
    return Promise.reject(error);
})
export default instance;